Page({
  data: {
    swiperList: [],
    catitemList:[],
    floorList:[]
  },
  onLoad: function () {
    //向后台发起请求
    //获取轮播图数据
    this.getSwiperList();

    //获取导航数据
    this.getCatList();

    //获取楼层数据
    this.getFloorList();

    //获取分类数据
    // this.getCatitems();

  },

  //轮播图
  getSwiperList:async function(){
    let {data} = await wx.homeApi.getSwiperData();
    // console.log(data);
    this.setData({
      swiperList: data.message
    })
  },

  //导航
  getCatList:async function(){
    let {data} = await wx.homeApi.getCatitems();
    // console.log(data);
    this.setData({
      catitemList: data.message
    })
  },

  //楼层
  //home/floordata
  getFloorList:async function(){
    let {data} = await wx.homeApi.getFloorData();
    console.log(data);
    this.setData({
      floorList: data.message
    })
  },
})